home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10975 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 64 61 | 72 77 69 6e 2e 55 43 53 |Path: da|rwin.UCS|
|00000010| 43 2e 45 44 55 21 72 6f | 79 61 6c 74 65 79 0a 46 |C.EDU!ro|yaltey.F|
|00000020| 72 6f 6d 3a 20 48 61 6c | 20 52 6f 79 61 6c 74 65 |rom: Hal| Royalte|
|00000030| 79 20 3c 72 6f 79 61 6c | 74 65 79 40 64 61 72 77 |y <royal|tey@darw|
|00000040| 69 6e 2e 55 43 53 43 2e | 45 44 55 3e 0a 4e 65 77 |in.UCSC.|EDU>.New|
|00000050| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000060| 6e 67 2e 63 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |ng.c.Sub|ject: Re|
|00000070| 3a 20 44 65 74 65 72 6d | 69 6e 69 6e 67 20 74 68 |: Determ|ining th|
|00000080| 65 20 6c 65 6e 67 74 68 | 20 6f 66 20 61 6e 20 69 |e length| of an i|
|00000090| 6e 74 20 69 6e 20 73 74 | 72 69 6e 67 20 66 6f 72 |nt in st|ring for|
|000000a0| 6d 0a 44 61 74 65 3a 20 | 57 65 64 2c 20 32 30 20 |m.Date: |Wed, 20 |
|000000b0| 4d 61 72 20 31 39 39 36 | 20 32 33 3a 30 38 3a 33 |Mar 1996| 23:08:3|
|000000c0| 30 20 2d 30 38 30 30 0a | 4f 72 67 61 6e 69 7a 61 |0 -0800.|Organiza|
|000000d0| 74 69 6f 6e 3a 20 55 6e | 69 76 65 72 73 69 74 79 |tion: Un|iversity|
|000000e0| 20 6f 66 20 43 61 6c 69 | 66 6f 72 6e 69 61 2c 20 | of Cali|fornia, |
|000000f0| 53 61 6e 74 61 20 43 72 | 75 7a 0a 4d 65 73 73 61 |Santa Cr|uz.Messa|
|00000100| 67 65 2d 49 44 3a 20 3c | 50 69 6e 65 2e 53 4f 4c |ge-ID: <|Pine.SOL|
|00000110| 2e 33 2e 39 31 2e 39 36 | 30 33 32 30 32 33 30 33 |.3.91.96|03202303|
|00000120| 31 30 2e 31 34 34 37 36 | 43 2d 31 30 30 30 30 30 |10.14476|C-100000|
|00000130| 40 64 61 72 77 69 6e 2e | 55 43 53 43 2e 45 44 55 |@darwin.|UCSC.EDU|
|00000140| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 33 |>.Refere|nces: <3|
|00000150| 31 34 36 44 30 35 38 2e | 44 44 37 40 63 62 6d 2e |146D058.|DD7@cbm.|
|00000160| 63 6f 6d 3e 20 3c 34 69 | 37 75 74 68 24 71 70 68 |com> <4i|7uth$qph|
|00000170| 40 69 6e 65 74 2d 6e 6e | 74 70 2d 67 77 2d 31 2e |@inet-nn|tp-gw-1.|
|00000180| 75 73 2e 6f 72 61 63 6c | 65 2e 63 6f 6d 3e 20 3c |us.oracl|e.com> <|
|00000190| 44 6f 45 33 38 75 2e 47 | 49 48 40 69 71 75 65 73 |DoE38u.G|IH@iques|
|000001a0| 74 2e 6e 65 74 3e 20 3c | 44 6f 47 73 35 44 2e 46 |t.net> <|DoGs5D.F|
|000001b0| 46 42 40 69 71 75 65 73 | 74 2e 6e 65 74 3e 20 3c |FB@iques|t.net> <|
|000001c0| 34 69 70 64 39 6b 24 65 | 70 38 40 6e 65 77 73 2e |4ipd9k$e|p8@news.|
|000001d0| 65 72 69 6e 65 74 2e 63 | 6f 6d 3e 0a 4e 4e 54 50 |erinet.c|om>.NNTP|
|000001e0| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 64 |-Posting|-Host: d|
|000001f0| 61 72 77 69 6e 2e 75 63 | 73 63 2e 65 64 75 0a 4d |arwin.uc|sc.edu.M|
|00000200| 69 6d 65 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |ime-Vers|ion: 1.0|
|00000210| 0a 43 6f 6e 74 65 6e 74 | 2d 54 79 70 65 3a 20 54 |.Content|-Type: T|
|00000220| 45 58 54 2f 50 4c 41 49 | 4e 3b 20 63 68 61 72 73 |EXT/PLAI|N; chars|
|00000230| 65 74 3d 55 53 2d 41 53 | 43 49 49 0a 49 6e 2d 52 |et=US-AS|CII.In-R|
|00000240| 65 70 6c 79 2d 54 6f 3a | 20 3c 34 69 70 64 39 6b |eply-To:| <4ipd9k|
|00000250| 24 65 70 38 40 6e 65 77 | 73 2e 65 72 69 6e 65 74 |$ep8@new|s.erinet|
|00000260| 2e 63 6f 6d 3e 20 0a 0a | 0a 0a 64 6c 6d 69 6c 6c |.com> ..|..dlmill|
|00000270| 65 72 40 69 71 75 65 73 | 74 2e 6e 65 74 20 28 44 |er@iques|t.net (D|
|00000280| 6f 75 67 20 4d 69 6c 6c | 65 72 29 20 77 72 6f 74 |oug Mill|er) wrot|
|00000290| 65 3a 0a 20 0a 3e 20 49 | 20 68 61 76 65 20 61 20 |e:. .> I| have a |
|000002a0| 76 61 72 69 61 62 6c 65 | 20 6f 66 20 74 79 70 65 |variable| of type|
|000002b0| 20 69 6e 74 2c 20 61 6e | 64 20 49 20 77 6f 75 6c | int, an|d I woul|
|000002c0| 64 20 6c 69 6b 65 20 74 | 6f 20 75 73 65 20 74 68 |d like t|o use th|
|000002d0| 65 20 73 70 72 69 6e 74 | 66 28 29 0a 3e 20 66 75 |e sprint|f().> fu|
|000002e0| 6e 63 74 69 6f 6e 20 74 | 6f 20 77 72 69 74 65 20 |nction t|o write |
|000002f0| 74 68 69 73 20 76 61 72 | 69 61 62 6c 65 20 74 6f |this var|iable to|
|00000300| 20 61 20 73 74 72 69 6e | 67 2e 20 20 48 6f 77 65 | a strin|g. Howe|
|00000310| 76 65 72 2c 20 49 20 77 | 61 6e 74 20 74 6f 0a 3e |ver, I w|ant to.>|
|00000320| 20 64 79 6e 61 6d 69 63 | 61 6c 6c 79 20 61 6c 6c | dynamic|ally all|
|00000330| 6f 63 61 74 65 20 74 68 | 65 20 73 70 61 63 65 20 |ocate th|e space |
|00000340| 66 6f 72 20 74 68 65 20 | 73 74 72 69 6e 67 2c 20 |for the |string, |
|00000350| 61 6e 64 20 6f 6e 6c 79 | 20 6d 61 6c 6c 6f 63 20 |and only| malloc |
|00000360| 65 6e 6f 75 67 68 0a 3e | 20 73 70 61 63 65 20 74 |enough.>| space t|
|00000370| 6f 20 68 6f 6c 64 20 74 | 68 65 20 69 6e 74 2e 0a |o hold t|he int..|
|00000380| 0a 54 72 79 20 74 61 6b | 69 6e 67 20 74 68 65 20 |.Try tak|ing the |
|00000390| 6c 6f 67 20 62 61 73 65 | 20 31 30 20 6f 66 20 74 |log base| 10 of t|
|000003a0| 68 65 20 69 6e 74 65 67 | 65 72 2c 20 61 64 64 20 |he integ|er, add |
|000003b0| 31 2c 20 74 68 65 6e 20 | 64 72 6f 70 20 74 68 65 |1, then |drop the|
|000003c0| 20 66 72 61 63 74 69 6f | 6e 61 6c 0a 70 6f 72 74 | fractio|nal.port|
|000003d0| 69 6f 6e 2e 20 20 20 54 | 68 61 74 20 6f 75 67 68 |ion. T|hat ough|
|000003e0| 74 20 74 6f 20 67 69 76 | 65 20 79 6f 75 20 74 68 |t to giv|e you th|
|000003f0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 68 61 72 |e number| of char|
|00000400| 61 63 74 65 72 20 70 6f | 73 69 74 69 6f 6e 73 20 |acter po|sitions |
|00000410| 69 74 27 6c 6c 0a 6f 63 | 63 75 70 79 2e 20 20 4e |it'll.oc|cupy. N|
|00000420| 4f 54 45 2a 20 55 73 65 | 20 62 61 73 65 20 31 30 |OTE* Use| base 10|
|00000430| 20 6c 6f 67 2c 20 5f 6e | 6f 74 5f 20 6c 6e 20 28 | log, _n|ot_ ln (|
|00000440| 6e 61 74 75 72 61 6c 20 | 6c 6f 67 29 21 20 20 20 |natural |log)! |
|00000450| 49 66 20 6e 65 67 61 74 | 69 76 65 20 0a 6e 75 6d |If negat|ive .num|
|00000460| 62 65 72 73 20 61 72 65 | 20 61 20 70 6f 73 73 69 |bers are| a possi|
|00000470| 62 69 6c 69 74 79 2c 20 | 79 6f 75 27 6c 6c 20 68 |bility, |you'll h|
|00000480| 61 76 65 20 74 6f 20 75 | 73 65 20 61 62 73 20 76 |ave to u|se abs v|
|00000490| 61 6c 75 65 20 66 6f 72 | 20 74 68 65 20 6c 6f 67 |alue for| the log|
|000004a0| 20 61 6e 64 0a 61 64 64 | 20 61 6e 20 65 78 74 72 | and.add| an extr|
|000004b0| 61 20 73 70 61 63 65 20 | 66 6f 72 20 74 68 65 20 |a space |for the |
|000004c0| 73 69 67 6e 2c 20 6f 66 | 20 63 6f 75 72 73 65 2e |sign, of| course.|
|000004d0| 20 20 20 49 20 63 61 6e | 27 74 20 69 6d 61 67 69 | I can|'t imagi|
|000004e0| 6e 65 20 77 68 79 20 79 | 6f 75 27 64 0a 77 61 6e |ne why y|ou'd.wan|
|000004f0| 74 20 74 6f 20 67 6f 20 | 74 68 72 6f 75 67 68 20 |t to go |through |
|00000500| 73 75 63 68 20 73 68 65 | 6e 61 6e 6e 69 67 61 6e |such she|nannigan|
|00000510| 73 20 68 6f 77 65 76 65 | 72 2c 20 62 79 74 65 73 |s howeve|r, bytes|
|00000520| 20 61 72 65 20 63 68 65 | 61 70 20 74 68 65 73 65 | are che|ap these|
|00000530| 20 64 61 79 73 2e 0a 0a | | days...| |
+--------+-------------------------+-------------------------+--------+--------+